#ifndef INTERFACE_KYMANAGER_PLUGIN_H_
#define INTERFACE_KYMANAGER_PLUGIN_H_

#include <kyplugin.h>
#include <QWidget>

class KyManagerPlugin
{
public:
    typedef void(generateReport_t)(std::string name, std::string data);

    virtual ~KyManagerPlugin() = default;

    /* 返回插件名 */
    virtual std::string name() = 0;
    /* 返回插件中文名 */
    virtual std::string nameCN() = 0;
    /* 返回插件描述 */
    virtual std::string description() = 0;
    /* 插件界面指针 */
    virtual QWidget *createWidget() = 0;

    /* 由插件管理器调用 , 用于给 generateReport 赋值 */
    void setGenerateReportCb(generateReport_t *point)
    {
        generateReport = point;
    }

protected:
    /* 用于插件回调 , 生成结果报告 */
    generateReport_t *generateReport = nullptr;
};


class KyManagerPluginProvider : public kyplugin::Provider
{
public:
    virtual KyManagerPlugin *create() const = 0;

    unsigned int getVersion() const
    {
        return providerVersion;
    }

private:
    friend class kyplugin::KyPlugin;

    std::string kypluginGetType() const
    {
        return providerType;
    }

    static const unsigned int providerVersion;
    static const unsigned int providerLowestVersion;
    static const std::string providerType;
};

#endif